package com.yingli.fragment_proiect;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.widget.ImageView;

import com.yingli.fragment_proiect.manager.ManagerActivity;

public class MainActivity extends AppCompatActivity {
    private ImageView ivAnim ;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        //跳转到利用管理方式来管理Fragment的界面
        findViewById(R.id.btn_manager).setOnClickListener(v -> {
            startActivity(new Intent(this, ManagerActivity.class));
        });

        //跳转到viewPager的Fragment的界面
        findViewById(R.id.btn_viewPager).setOnClickListener(v -> {});

        //帧动画
        AnimationDrawable drawable;
        ivAnim = findViewById(R.id.iv_anim);
        ivAnim.setImageResource(R.drawable.anim_start);
        drawable = (AnimationDrawable) ivAnim.getDrawable();
        drawable.start();
    }
}